package com.ruoyi.web.controller.app.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@Valid
@ApiModel(value = "RequestRegisterSetPayPasswordEntity")
public class RequestRegisterSetPayPasswordEntity {

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^(1[3-5|7-9][0-9])\\d{8}$", message = "请输入正确手机号")
    @ApiModelProperty(value = "手机号", position = 1, required = true)
    private String phone;

    @NotBlank(message = "验证码不能为空")
    @Length(min = 4, max = 4, message = "验证码长度不正确")
    @ApiModelProperty(value = "验证码", position = 2, required = true)
    private String code;

    @NotBlank(message = "新密码不能为空")
    @Length(min = 6, message = "支付密码长度不能小于6位")
    @Length(max = 12, message = "支付密码长度不能大于12位")
    @ApiModelProperty(value = "新密码", position = 3, required = true)
    private String password;
}
